package de.jmda.mproc.swingui;

import java.io.File;
import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;

import de.jmda.gui.swing.mvc.ModelBase;
import de.jmda.util.fileset.FileSetJavaFilesOnly;
import de.jmda.util.gui.swing.JPanelFavouritesModel;

@XmlRootElement
public class JPanelVisualProcessorModel
    extends ModelBase
{
	/**
	 * Value is used in <code>package-info</code> and defines the XML namespace
	 * for this and other JAXB classes in this package.
	 */
	public final static String XML_NAMESPACE = "http://code.google.com/p/jmda/core/swingui";

	@XmlAttribute
	private String configurationName;

	@XmlElementWrapper
	@XmlElements
	(
			@XmlElement(name="annotationProcessorClassName")
	)
	private List<String> annotationProcessorClassNames;
	
	@XmlElement
//	@XmlTransient
	private JPanelFileSetJavaSourceFilesModel jPanelFileSetJavaSourceFilesModel;

	/**
	 * required by JAXB
	 */
  private JPanelVisualProcessorModel()
	{
		super();
	}
	
	public JPanelVisualProcessorModel(String configurationName)
	{
		this(
				configurationName,
				new LinkedList<String>(),
				new JPanelFileSetJavaSourceFilesModel(
						new FileSetJavaFilesOnly(),
						new JPanelFavouritesModel(
								new LinkedList<File>())));
	}

	public JPanelVisualProcessorModel(
			String configurationName,
			List<String> annotationProcessorClassNames,
			JPanelFileSetJavaSourceFilesModel jPanelFileSetJavaSourceFilesModel)
  {
	  this();
	  this.configurationName = configurationName;
	  this.annotationProcessorClassNames = annotationProcessorClassNames;
	  this.jPanelFileSetJavaSourceFilesModel = jPanelFileSetJavaSourceFilesModel;
  }
	
	public String getConfigurationName()
  {
  	return configurationName;
  }

	public List<String> getAnnotationProcessorClassNames()
  {
  	return annotationProcessorClassNames;
  }

	public JPanelFileSetJavaSourceFilesModel getjPanelFileSetJavaSourceFilesModel()
  {
  	return jPanelFileSetJavaSourceFilesModel;
  }
}